package com.aplink.generic.util.objectrule;

import com.aplink.generic.pojo.GenericObject;

public class ObjectLoadBaseRule extends ObjectBaseRule {
    private static final long serialVersionUID = -6745195796721880191L;
    public ActionBaseRule actionBaseRule;

    public ObjectLoadBaseRule() {
        this.actionBaseRule = null;
    }

    public ObjectLoadBaseRule(final ActionBaseRule _actionBaseRule) {
        this.actionBaseRule = _actionBaseRule;
    }

    public ActionBaseRule getActionBaseRule() {
        return this.actionBaseRule;
    }

    @Override
    public boolean isSatisfiedCondition(final GenericObject genericObject,
            final int BuffMaxRec) {

        /***
         * remember that in the case genericObject == null is used for
         * <objnotloaded/> remember that BuffMaxRec is attribute that only is
         * used for <maxrec>2</maxrec>
         */
        boolean isSatisfied = false;

        if (genericObject != null) {
            isSatisfied = this.actionBaseRule
                    .isSatisfiedActionRule(genericObject);
        }
        return isSatisfied;
    }

}
